<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">



<head>
    <th:block th:include="include :: header('登录')" />
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">T</h1>

            </div>
            <h3>欢迎使用 同多优</h3>

                <div class="form-group">
                    <input type="text" id="username" name="username" class="form-control" placeholder="用户名" required="" value="admin">
                </div>
                <div class="form-group">
                    <input type="password" id="password" name="password" class="form-control" placeholder="密码" required="" value="1234">
                </div>
                <button type="submit" class="btn btn-primary block full-width m-b" >登 录</button>

        </div>
    </div>

    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        $(document).on('click', '.m-b', function () {
            var data = {
                "username": $("#username").val(),
                "password": $("#password").val()
            };
            $.ajax({ url: "login", data: data, success: function(result){
                    if(result.code == 0){
                        location.href = "index";
                    }else{
                        console.log(result)
                        layer.msg(result.msg);
                    }
                }});
        })

        Splitting()
        gsap.set('.char', {
            '--hue': gsap.utils.distribute({
                base: 0,
                amount: 330,
            })
        })
        gsap.to('.char', {
            '--weight': 700,
            '--saturation': 80,
            ease: 'sine.inOut',
            duration: 0.5,
            stagger: {
                yoyo: true,
                repeat: -1,
                each: 0.15,
            }
        }).time(2)
    </script>
    

</body>

</html>
